package tag37_01_09.threadsApi;

public class Th05_Api {

	public static void main(String[] args) {

		Thread t1 = new Thread();
		System.out.println(t1);

		Thread t2 = new Thread("Tom");
		System.out.println(t2);

		Thread t3 = new Thread();
		System.out.println("t3.getName: "+ t3.getName());
		t3.setName("Jerry");
		System.out.println("t3.getName: "+ t3.getName());

		Runnable target = new Runnable() {
			
			@Override
			public void run() {

				System.out.println("test");
			}
		};
		
		Thread t4 = new Thread(target);
		Thread t5 = new Thread(target, "Mary");

		
		//------------------------------------------------------

		System.out.println("t3.getName: "+ t3.getId());  // Eindeutig
		
		Thread mainThread = Thread.currentThread();
		System.out.println(mainThread);
		
		
		System.out.println("-------------------------------------------");
		
		Thread tUnwichtig = new Thread();
		
		tUnwichtig.setPriority( Thread.MAX_PRIORITY);  //10
//		tUnwichtig.setPriority( Thread.NORM_PRIORITY); //5 
//		tUnwichtig.setPriority( Thread.MIN_PRIORITY);  //1
		
		System.out.println(tUnwichtig.getPriority());
		
	}// end of main

}
